package com.herui.ota.service.iml;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.herui.ota.dao.mysql.AppInfoMapper;
import com.herui.ota.entity.AppInfo;
import com.herui.ota.service.AppInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * author name: amanda.shan
 * create time: 2024-05-09 17:16:00
 */ 
@Service
public class AppInfoServiceIml extends BaseService<AppInfoMapper, AppInfo> implements AppInfoService{

	@Autowired
	@Override
	public void setBaseMapper(AppInfoMapper baseMapper) {
		super.setBaseMapper(baseMapper);
	}

	@Override
	public synchronized void save(AppInfo entity) {
		int count = count();
		if (count > 0){
			remove(new QueryWrapper<>());
		}
		super.save(entity);
	}
}

